# !/usr/bin/env python
# encoding: utf-8


"""
  @author: gaogao
  @file: N7786C_App.py
  @time: 2022/3/12 10:41
  @desc:
"""

from ATS.instrumentDriver.InstGenSS.InstGenSS_N7786C import SS_N7786C


class N7786C_App:
    def __init__(self, name):
        self.n7786c = SS_N7786C(name)

    def get_idn(self):
        return self.n7786c.idn()

    def demo(self):
        self.n7786c.demo()

    def reset(self):
        return self.n7786c.reset()

    def set_power_unit(self):
        self.n7786c.set_power_unit()

    def set_trigger_conf_mode(self, mode=2):
        self.n7786c.set_trigger_config_mode(mode)

    def trigger(self):
        self.n7786c.trigger()

    def set_stabilization_mode(self, mode):
        self.n7786c.set_stabilization_mode(mode)

    def set_polarization_value(self, s1, s2, s3):
        self.n7786c.set_polarization_value(s1, s2, s3)

    def stop_logging_polcontroller(self):
        self.n7786c.stop_logging_polcontroller()

    def set_external_trigger_delay(self):
        self.n7786c.set_external_trigger_delay()

    def get_opc_state(self):
        return self.n7786c.get_opc_state()

    def get_polarization_sweep_data(self):
        return self.n7786c.get_polarization_sweep_data()

    def get_logged_value(self):
        return self.n7786c.get_logged_value()

    def trigger_output_mode(self):
        self.n7786c.trigger_output_mode()

    def set_random_points_stepwidth(self, points=20000, stepwidth=1000):
        self.n7786c.set_random_points_stepwidth(points, stepwidth)

    def set_sample_point_rate(self, points=20000, rate=8000, average_time=100):
        self.n7786c.set_sample_point_rate(points, rate, average_time)

    def set_wave_length(self, wave_length):
        self.n7786c.set_wave_length(wave_length)

    def start_polarimeter_logging(self):
        self.n7786c.start_polarimeter_logging()

    def start_polarization_sequence(self):
        self.n7786c.start_polarization_sequence()
